package it.univaq.mwt.backoffice.form;

import org.apache.struts.upload.FormFile;
import org.apache.struts.validator.ValidatorForm;


public class AddGiftForm extends ValidatorForm
{
	
	private static final long serialVersionUID = 1L;
	
	private String name=null;
	private String descrizione=null;
	private String link=null;
	private String linkname=null;
	private String price=null;
	private FormFile uploadedfile = null;
	private String categoryList=null;
	
	

	public String getCategoryList() {
		return categoryList;
	}

	public void setCategoryList(String categoryList) {
		this.categoryList = categoryList;
	}

	public String getDescrizione() {
		return descrizione;
	}

	public void setDescrizione(String descrizione) {
		this.descrizione = descrizione;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	public String getLinkname() {
		return linkname;
	}
	public void setLinkname(String linkname) {
		this.linkname = linkname;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	/*public File getUploadedfile() {
		return uploadedfile;
	}
	public void setUploadedfile(File uploadedfile) {
		this.uploadedfile = uploadedfile;
	}*/
	
	

	    public FormFile getUploadedfile() {
		return uploadedfile;
	}

	public void setUploadedfile(FormFile uploadedfile) {
		this.uploadedfile = uploadedfile;
	}

//		public void reset(ActionMapping mapping, HttpServletRequest request) {
//        
//	    	this.name=null;
//	    	this.link=null;
//	    	this.linkname=null;
//	    	this.price=null;
//	    	this.uploadedfile = null;
//	    	this.descrizione=null;
//	    	this.categoryList=null;
//	    	
//        }

        /**
         * Reset all properties to their default values.
         *
         * @param mapping The mapping used to select this instance
         * @param request The servlet request we are processing
       * @return errors
         */
//      public ActionErrors validate( 
//          ActionMapping mapping, HttpServletRequest request ) {
//          ActionErrors errors = new ActionErrors();
//          
//          if( getName() == null || getName().length() < 1 ) {
//            errors.add("name",new ActionMessage("error.username.required"));
//          }
//          if( getLink() == null || getLink().length() < 1 ) {
//            errors.add("link",new ActionMessage("error.passoword.required"));
//          }
//          if( getLinkname() == null || getLinkname().length() < 1 ) {
//              errors.add("linkname",new ActionMessage("error.email.required"));
//          }
//          if( getPrice() == null || getPrice().length() < 1 ) {
//              errors.add("price",new ActionMessage("error.email.required"));
//          }
//          if( getUploadedfile() == null  ) {
//              errors.add("uploadedfile",new ActionMessage("error.email.required"));
//          }
//          if( getDescrizione() == null || getDescrizione().length() < 1 ) {
//              errors.add("Descrizione",new ActionMessage("error.descrizione.required"));
//          }
//          if( getCategoryList() == null  ) {
//              errors.add("price",new ActionMessage("error.email.required"));
//          }
//          return errors;
//      }
//	
}
